//
//  NSObject+MBP.m
//  myXianfeng
//
//  Created by 马继鵬 on 17/4/26.
//  Copyright © 2017年 EPM. All rights reserved.
//

#import "NSObject+MBP.h"
#import "MBProgressHUD.h"
#import <QuartzCore/QuartzCore.h>

@implementation NSObject (MBP)

- (void)customViewExampleWithImage:(NSString*) imgName title:(NSString*)title View:(UIView*)view{
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
    
    // Set the custom view mode to show any view.
    hud.mode = MBProgressHUDModeCustomView;
    // Set an image view with a checkmark.
    UIImage *image = [[UIImage imageNamed:imgName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    hud.customView = [[UIImageView alloc] initWithImage:image];
    // Looks a bit nicer if we make it square.
    hud.square = YES;
    // Optional label text.
    hud.label.text = NSLocalizedString(title, @"HUD done title");
    
    [hud hideAnimated:YES afterDelay:3.f];
    
    
}
@end
